﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using ComLib.ComType;

namespace CardQCProcessor
{
    /// <summary>
    /// 一所质检请求类型
    /// </summary>
    public enum QCProcessMethod : int
    {
        None = -99,            // 未知操作
        QC = 0,                  // 一所照片质检操作
        ExitApp = 1,           // 关闭应用程序
    }

    /// <summary>
    /// 一所质检请求参数
    /// </summary>
    [DataContract]
    public class QCRequestArgs
    {
        /// <summary>
        /// 请求命令类型
        /// </summary>
        [DataMember]
        public QCProcessMethod Method { get; set; }= QCProcessMethod.None;

        /// <summary>
        /// 请求质检的照片文件名称（完整路径）
        /// </summary>
        [DataMember]
        public string CheckFileName { get; set; }

        /// <summary>
        /// 照片业务应用类型
        /// </summary>
        [DataMember]
        public ApplyTo ApplyType { get; set; }
    }

    /// <summary>
    /// 一所质检处理结果参数
    /// </summary>
    [DataContract]
    public class QCHandleResultArgs
    {
        /// <summary>
        /// 请求处理的命令类型
        /// </summary>
        [DataMember]
        public QCProcessMethod RequestMethod { get; set; } = QCProcessMethod.None;

        /// <summary>
        /// 请求质检的照片文件名称（完整路径）
        /// </summary>
        [DataMember]
        public string CheckFileName { get; set; }

        /// <summary>
        /// 一所质检处理结果文件名称（完整路径）
        /// </summary>
        [DataMember]
        public string DestFileName { get; set; }

        /// <summary>
        /// 质检操作是否执行成功
        /// </summary>
        [DataMember]
        public bool CallSuccess { get; set; } = false;

        /// <summary>
        /// 照片业务应用类型
        /// </summary>
        [DataMember]
        public ApplyTo App { get; set; }

        /// <summary>
        /// 质检是否合格
        /// </summary>
        [DataMember]
        public bool Pass { get; set; } = false;

        /// <summary>
        /// 是否人工强行设置合格
        /// </summary>
        [DataMember]
        public bool ManualSetPass { get; set; } = false;

        /// <summary>
        /// 检测不合格的原因
        /// </summary>
        [DataMember]
        public string UnpassReason { get; set; }

        /// <summary>
        /// 检测过程中程序运行时错误
        /// </summary>
        [DataMember]
        public string RuntimeError { get; set; }
    }
}
